home *** CD-ROM | disk | FTP | other *** search
- Path: ts169.eiu.bgu.edu!MJ-PHeee
- From: MJ-PHeee@bgu.edu (Martin Phee)
- Newsgroups: comp.lang.c
- Subject: Memory available during execution...
- Date: Wed, 7 Feb 1996 01:32:17 +1000
- Organization: Educational Computing Network
- Message-ID: <MJ-PHeee.1.01147BBA@bgu.edu>
- NNTP-Posting-Host: ts169.eiu.bgu.edu
- Keywords: memory, coreleft...
- X-Newsreader: Trumpet for Windows [Version 1.0 Rev B]
-
- In borland we used farcoreleft to retrieve how much memory we had during
- program execution. We recently moved our program to MSVC, and need a way to
- calculated how much avaiable memory there is during program execution. This
- is a dos program...
-
- I have been using the little function to calculate the memory..
-
- long get_farheap()
- {
- unsigned long size = 0L;
- int heapstatus;
- _HEAPINFO hinfo;
-
- hinfo._pentry = NULL;
- while((heapstatus = _fheapwalk( &hinfo)) != _HEAPEND)
- {
- if(hinfo._useflag == _FREEENTRY)
- size += (long)hinfo._size;
- }
- return(size);
- }
-
- I doesn't seen to give accurate sizes back. It can range anywhere from 11k to
- 90k. When I know that it should be much higher...
-
- marty
-